<template>
  <div class="goodsDetail">
<view class="header_swiper">
  <uv-swiper 
     :circular="true"
     height="250"
			:list="list2" 
			@change="e => current2 = e.current" 
			:autoplay="false" 
			indicatorStyle="right: 0rpx">
			<template v-slot:indicator>
				<view class="indicator-num">
					<text class="indicator-num__text">{{ current2 + 1 }}/{{ list2.length }}</text>
				</view>
			</template>
		</uv-swiper>
</view>

<view class="priceheader">
  <view class="price">
    <view class="priceText">￥{{ goodsData.price }}</view>
    <view class="priceText_text">{{ goodsData.shopName }}</view>
  </view>

  <view class="title">{{ goodsData.goodsTitle }}</view>

  <view class="kc">库存：{{ goodsData.stock }}</view>
</view>
<uv-gap height="12rpx" bgColor="#F8F8F8"></uv-gap>


<view @click="skuShowChoose = true" class="choose">
<view >已选</view>
&nbsp;&nbsp;
<view v-if="!skuChooseData">
  <lable style="margin-right: 10rpx;" v-for="(item) in Object.values(skus[0].sku_attrs)" :key="item">{{ item }}</lable>
  <lable >1件</lable>
</view>
<view v-if="skuChooseData">
  <lable style="margin-right: 10rpx;" v-for="(item) in skuChooseData.skuText" :key="item">{{ item }}</lable>
  <lable >{{skuChooseData.num}}件</lable>
</view>
<view class="left">
  <uv-icon size="25rpx" name="arrow-right"></uv-icon>
</view>
</view>

<uv-gap height="12rpx" bgColor="#F8F8F8"></uv-gap>


<view class="goods_detail">
  <view class="title">商品详情</view>

  <uv-parse container-style="width:100%" :content="Detailcontent"></uv-parse>
</view>
  </div>


  <view class="bottom_nav">
     <view style="position: relative;" class="leftbox">
      <button style="position: absolute;    z-index: 999;
    opacity: 0;" open-type="contact">123</button>
        <view><uv-icon name="kefu-ermai" color="#262424" size="50rpx"></uv-icon></view>
       <view>客服</view>
     </view>

     <view class="right_box">

      <uv-button @click="shopCar" customTextStyle="font-size:24rpx" type="error" shape="circle" :plain="true" :hairline="true" text="加入购物车"></uv-button>
      &nbsp;&nbsp;&nbsp;
      <uv-button @click="shopBuy" customTextStyle="font-size:24rpx" type="error" shape="circle" text="立即购买"></uv-button>
    </view>

  </view>

  <uv-popup ref="popupBuy" round="20">
			<view style="padding: 20rpx;">
			 <view style="display: flex;align-items: center;justify-content: center;margin-bottom: 
       50rpx;font-weight: bold;font-size: 28rpx;">
         购物须知
      </view>
      <view style="font-size: 24rpx;"> 
        &nbsp;&nbsp;&nbsp;&nbsp;尊敬的会员朋友，购物前请仔细阅读以下内容，以免产生错误购买。
        详情请仔细查阅以下：
        <span @click="check1"  style="color: red;">《购卡须知》</span>
        <span @click="check1" style="color: red;">《排队返利须知须知》</span>
      </view>

      <view style="display: flex;align-items: center;justify-content: space-between;margin-top: 50rpx;">
            
    
        <uv-button @click="NOOK" customTextStyle="font-size:22rpx;width:200rpx" type="error" shape="circle" :plain="true" :hairline="true" text="取消"></uv-button>
        <uv-button @click="OK" customTextStyle="font-size:22rpx;width:400rpx" type="error" shape="circle" text="已知晓并继续"></uv-button>
      </view>
			</view>
		</uv-popup>

  <geek-sku
            v-model="skuShowChoose"
            :data="skus"
           
            :notStockDisabled="true"
            :themeColor="[254, 59, 48]"
            :defaultCover="list2[0]"
            btnConfirmText="确认"
            notSelectSku="请选择完整的商品信息"
           
            @confirm="skuConfirm"
 ></geek-sku>



 <geek-sku
            v-model="skuShowShop"
            :data="skus"
           
            :notStockDisabled="true"
            :themeColor="[254, 59, 48]"
            :defaultCover="list2[0]"
            btnConfirmText="加入购物车"
            notSelectSku="请选择完整的商品信息"
           
            @confirm="skuConfirmShop"
 ></geek-sku>


 <geek-sku
            v-model="skuShowBuy"
            :data="skus"
           
            :notStockDisabled="true"
            :themeColor="[254, 59, 48]"
            :defaultCover="list2[0]"
            btnConfirmText="立即购买"
            notSelectSku="请选择完整的商品信息"
           
            @confirm="skuConfirmBuy"
 ></geek-sku>


     <uv-popup ref="popupCheck1">
      <view style="padding: 20rpx">
        <scroll-view style="height: 80vh" :scroll-y="true">
          <uv-parse :content="checkContent"></uv-parse>
        </scroll-view>
      </view>
    </uv-popup>

</template>

<script setup>
import { object } from "@climblee/uv-ui/libs/function/test";
import { ref } from "vue";
import {goodsDetail,changeItem} from '../../src/https/api/goodsDetail'
import { onShow } from "@dcloudio/uni-app";

let popupBuy = ref(null)

let popupCheck1 = ref(null)

let checkContent = ref('')

let goodsData = ref({

})


let check1 = () =>{
  popupCheck1.value.open('bottom')
  checkContent.value = `<div class="WordSection1" style="layout-grid:15.6pt">

<p class="MsoNormal" align="center" style="text-align:center;line-height:22.0pt;
mso-line-height-rule:exactly"><b><span lang="ZH-CN" style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">购卡须知</span></b><b><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></b></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">会员资格</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、对会员的入会资格评定权归国景（西京）游泳馆所有</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、符合本游泳馆部的各项章程并且办理会员卡后，方可取得国景（西京）游泳馆会员资格</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员卡是证明会员资格的凭证，仅供本人使用，不得私自转让</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、本游泳馆会员须年满</span>8<span lang="ZH-CN">周岁</span>(<span lang="ZH-CN">身高</span>1.2<span lang="ZH-CN">米以上</span>)<span lang="ZH-CN">不满</span>65<span lang="ZH-CN">周岁且身体健康，儿童游泳须有家人陪护。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">一、总纲</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、会员卡自办卡日起</span>3<span lang="ZH-CN">个月之内开卡</span>(<span lang="ZH-CN">特惠卡除外</span>),<span lang="ZH-CN">过期未开卡视为作废。会员卡自开卡日之起有效期一年</span>(<span lang="ZH-CN">特惠卡除外</span>)<span lang="ZH-CN">，过期失效。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、会员卡一经售出，概不退换。会员卡如有遗失或被盗，需及时补办，本俱乐部管理处将收取</span>30<span lang="ZH-CN">元的补办卡费，</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、年卡类会员必须是本人，并出示会员卡才能进入游泳馆</span>;<span lang="ZH-CN">如果忘记携带，应凭借会员卡号和本人身份证进入俱乐部。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、游泳馆的营业时间为</span>:9:00-21:00<span lang="ZH-CN">。每周一、周五 早上为</span>10:00<span lang="ZH-CN">营业。本馆有权根据特殊需要适当调整营业时间并店内公示。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">二、会员权利</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、报停</span>:<span lang="ZH-CN">会员因个人原因不能正常参加游泳，会员可申请报停，每张会员卡享有最多三次报停的权利，报停时间累计最长三个月。报停必须以书面形式提前办理并取得本馆管理处同意方可生效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、女会员如在会员期限内怀孕凭借县级以上医院证明，可给予办理会员卡报停手续，报停时间最长不超过十二个月。报停必须以书面形式提前办理并取得本馆管理处同意方可生效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、为答谢会员长期以来对本游泳馆的支持，会员生日当天凭借有效会员卡可领取游泳票两张</span>;<span style="mso-tab-count:1">&nbsp;&nbsp; </span>:<span lang="ZH-CN">坚类斗员会</span><span style="mso-tab-count:1"> </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、针对本游泳馆的服务，会员有提出批评、投诉及改进建议的权利</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">三、会员义务</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;">:<span style="mso-tab-count:2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、如实向游泳馆前台提供个人信息资料。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、严禁心肺功能疾病、皮肤病、传染病、高血压患者进入本游泳馆，有以上疾病的患者隐瞒病情取得会员资格的，本游泳馆有权终止其会员资格，并保留追究其法律权利。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员严禁携带</span>1.2<span lang="ZH-CN">米以下儿童进入游泳区域，对于擅自进入游泳区域造成伤害的，本游泳馆概不负责</span>.<span lang="ZH-CN">赫</span>):<span lang="ZH-CN">主备</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、严禁在本游泳馆吸烟、进食。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">5<span lang="ZH-CN">、严禁携带宠物进入本游泳馆。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">6<span lang="ZH-CN">、严禁在本游泳馆内大声喧哗，使用污秽语言以及一切违法活动。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">7<span lang="ZH-CN">、本游泳馆不接受</span>65<span lang="ZH-CN">岁以上老人入会，能出具真实有效的健康证明且签订免责申明者除外，但因隐瞒或错报个人年龄、健康等信息，而发生的一切责任都由其本人承担。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">四、免责条款</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><span style="mso-tab-count:1">&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、遇不可抗力</span>(<span lang="ZH-CN">如战争、自然灾害等</span>)<span lang="ZH-CN">造成本游泳馆营业终止或会员会籍不能继续，致使会员遭受损失，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、会员所受损害是因其自身故意或过失造成的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、会员所受损害是本游泳馆工作人员以外的任何第三方故意或过失行为导致的，本馆不予承担任何责任</span>,<span lang="ZH-CN">金员会</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">4<span lang="ZH-CN">、受害方严重违反本馆制定的规章制度所造成的损害，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">5<span lang="ZH-CN">、未交由本游泳馆保管</span>,<span lang="ZH-CN">而由会员或会员随同人员个人保管的贵重物品发生毁损、遗失的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">6<span lang="ZH-CN">、因会员资料或个人信息发生变动未及时通知本馆，从而造成损失或会员权利受限的，本馆不予承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">7<span lang="ZH-CN">、未听从本游泳馆工作人员指导，擅自跳水、戏水造成自身受伤，及他人受伤的，其本人应承担全部赔偿责任，对此本游泳馆不承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">8<span lang="ZH-CN">、因会员自身行为不当或会员之间的争议产生的人身和财产损失，本游泳馆不承担责任</span>;<span lang="ZH-CN">新圆劲青申本</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">9<span lang="ZH-CN">、会员未及时告知自身患有或隐瞒重大疾病病症或病史发生意外时，对此本游泳馆不承担任何责任</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">10<span lang="ZH-CN">、会员饮酒、吸毒或使用其他违禁药品后发生意外时，对此本游泳馆不承担任何责任。人衣盖后公长</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">五、安全提示</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、会员在游泳前</span>,<span lang="ZH-CN">先冲淋再做必要的热身练习再下水</span>,<span lang="ZH-CN">本游泳馆禁止跳水</span>,<span lang="ZH-CN">以免受伤。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、过度游泳及违规游泳均有受伤的可能，所以您在运动前应对自己的身体情况进行判断，并保持运动强度和时间的适当。</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height:22.0pt;mso-line-height-rule:exactly"><span lang="ZH-CN" style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;
mso-bidi-font-family:&quot;Microsoft YaHei&quot;">六、会员承诺</span><span style="font-size:12.0pt;font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:
&quot;Microsoft YaHei&quot;"><o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">1<span lang="ZH-CN">、本人保证所提供的入会资料及个人信息真实有效</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">2<span lang="ZH-CN">、本人身体健康且没有本协议约定的不适合进行运动的疾病</span>;<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0;
line-height:22.0pt;mso-line-height-rule:exactly"><span style="font-size:12.0pt;
font-family:&quot;Microsoft YaHei&quot;,sans-serif;mso-bidi-font-family:&quot;Microsoft YaHei&quot;">3<span lang="ZH-CN">、本人已阅读、理解并同意上述条文。</span><o:p></o:p></span></p>

</div>
  `
}

let OK = () => {
  popupBuy.value.close()
  skuShowBuy.value = true
}

let NOOK = () => {
  skuShowBuy.value = false
  console.log(popupBuy.value)
  popupBuy.value.close()
}

let Detailcontent = ref('')
function parseStringToObj(str) {
    // 将字符串按分号分隔为属性列表
    var attrs = str.split(';');
    
    var obj = {};
    
    // 遍历属性列表并将其分割为键值对
    for (var attr of attrs) {
        var pair = attr.split(':');
        if (pair.length === 2) {
            // 删除两边空白并添加到新对象中
            var key = pair[0].trim();
            var value = pair[1].trim();
            obj[key] = value;
        }
    }

    return obj;
}

let suksImg = ref('')
let getgoodsDetail =async (data) => {
  let resMAP = await goodsDetail(data)
  if(resMAP){
    let res = {
      ...resMAP.data,
      shopName:resMAP.data.shopName || '暂无店铺',
      price:resMAP.data.price,
      goodsTitle:resMAP.data.prodName,
      stock:resMAP.data.totalStocks,
      goodsSwiper:resMAP.data.imgs.split(','),
      skus:resMAP.data.skuList.map((v,i)=>{
        return {
          id:v.skuId ,
          price:v.price,
          stock:v.stocks,
          sku_attrs:parseStringToObj(v.properties)
        }
      })
    }
  console.log(res)
goodsData.value = res
skus.value = res.skus
list2.value = res.goodsSwiper
Detailcontent.value = goodsContentConv(resMAP.data.content)
suksImg.value = resMAP.data.pic
  }
}


let  goodsContentConv = (content) =>{
  if (!content) {
      return
    }
    content = content.replace(/<p/gi, '<p style="max-width:100% !important;word-wrap:break-word;word-break:break-word;" ')
    content = content.replace(/<img/gi, '<img style="max-width:100% !important;height:auto !important;margin:0;display:flex;" ')
    content = content.replace(/style="/gi, 'style="max-width:100% !important;table-layout:fixed;word-wrap:break-word;word-break:break-word;')
    content = content.replace(/<table/gi, '<table style="table-layout:fixed;word-wrap:break-word;word-break:break-word;" ')
    content = content.replace(/<td/gi, '<td cellspacing="0" cellpadding="0" style="border-width:1px; border-style:solid; border-color:#666; margin: 0px; padding: 0px;"')
    content = content.replace(/width=/gi, 'sss=')
    content = content.replace(/height=/gi, 'sss=')
    content = content.replace(/\/>/gi, ' style="max-width:100% !important;height:auto !important;margin:0;display:block;" />')
    return content
  }


let goodsDetailData = ref({})
onShow(()=>{
  goodsDetailData.value = JSON.parse(uni.getStorageSync('goodsDetailData'))
  getgoodsDetail({...goodsDetailData.value})
})

let shopCar = () => {
  skuShowShop.value = true
}

let shopBuy = () => {
  popupBuy.value.open('bottom')
 
}

let skuShowShop = ref(false)
let skuShowChoose = ref(false)
let skuShowBuy = ref(false)
let skuChooseData = ref(null)
  // sku列表
  let skus = ref([
        {
            id: 1,
            price: 7000,
            stock: 30,
            sku_attrs: {
                '分类': '深空黑色',
                '重量': '128G',
                
            }
        },
        {
            id: 2,
            price: 8500,
            stock: 10,
            sku_attrs: {
                '分类': '深空黑色2',
                '重量': '128G',
                
            }
        },
        {
            id: 3,
            price: 9500,
            stock: 0,
            sku_attrs: {
                '分类': '深空黑色3',
                '重量': '128G',
                
            }
        },
        {
            id: 4,
            price: 9200,
            stock: 60,
            sku_attrs: {
                '分类': '深空黑色4',
                '重量': '128G',
                
            }
        },
        {
            id: 5,
            price: 9200,
            stock: 80,
            sku_attrs: {
                '分类': '深空黑色5',
                '重量': '128G',
                
            }
        }
    ])

   
    // sku确认事件
    let skuConfirm = (e)=>{
      skuChooseData.value = e
      skuShowChoose.value = false
        console.log(e);
    }


    let skuConfirmShop =async (e)=>{
      if(uni.getStorageSync('userInfo')){
        skuChooseData.value = e
      skuShowShop.value = false
        console.log(e);
          let obj = {
          basketId:0,
          count:e.num,
          prodId:goodsData.value.prodId,
          shopId:goodsData.value.shopId,
          skuId:e.sku.id
        }
        let res = await changeItem(obj)
        if(res.code ==='00000'){
          uni.showToast({
            title: '加入购物车成功',
         icon: 'none'
          })
        }
      }else{
        uni.showToast({
        title:'请先登录，自动跳转到登录页面',
        icon:'none',
        duration:2000,
        
      })

      setTimeout(()=>{
        uni.switchTab({
        url:'/pages/my'
      }
      )
      },2000)
      }
      
    }

    let skuConfirmBuy = (e) => {
    if(uni.getStorageSync('userInfo')){
      uni.navigateTo({
        url:'/pages/settlement'
      })
      let obj ={
        addrId:0,
        couponIds:[],
        orderItem:{
        prodCount:e.num,
       prodId:goodsData.value.prodId,
          shopId:goodsData.value.shopId,
          skuId:e.sku.id
        },
        userChangeCoupon:1,
      }
      uni.setStorageSync('orderInfoDetail',JSON.stringify(obj))
      
    }else{
      uni.showToast({
        title:'请先登录，自动跳转到登录页面',
        icon:'none',
        duration:2000,
        
      })
      

      setTimeout(()=>{
        uni.switchTab({
        url:'/pages/my'
      }
      )
      },2000)
    }
      
      skuShowBuy.value = false
    }

let current2 = ref(0)

let list2= ref([
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				])

</script>

<style lang="scss" scoped>
.image_item_tex{
  margin-bottom: 20rpx;
}
.bottom_nav{
  .right_box{
    display: flex;
    align-items: center;
  }
  .leftbox{
    font-size: 18rpx;
font-family: PingFangSC;
font-weight: 400;
color: #262424;
    display: flex;
    flex-direction: column;
    align-items: center;

  }
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20rpx;
  padding-bottom: 35rpx;
}
.goods_detail{
  padding: 20rpx;
  .title{
    margin-bottom: 20rpx;
    font-size: 30rpx;
font-family: PingFangSC;
font-weight: 500;
color: #262424;
  }
}
.choose{
  .left{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20rpx;
  }
  position: relative;
  font-size: 24rpx;
font-family: PingFangSC;
font-weight: 400;
color: #262424;
  display: flex;
  align-items: center;
  padding: 20rpx;
}
.priceheader{
  .kc{
   
font-size: 24rpx;
font-family: PingFangSC;
font-weight: 400;
color: #999393;
padding: 0 20rpx;
  }
  .title{
    margin-bottom: 15rpx;
    padding: 0 20rpx;
    font-size: 30rpx;
font-family: PingFangSC;
font-weight: 500;
color: #262424;

  }
  .priceText_text{
    font-size: 24rpx;
font-family: PingFangSC;
font-weight: 400;
color: #999393;
  }
  .priceText{
    font-size: 56rpx;
font-family: HelveticaNeue;
font-weight: 500;
color: #FF5951;
  }
  .price{

    padding: 10rpx;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  margin-bottom: 15rpx;
}
.goodsDetail{
  padding-bottom: 100rpx;
}
@mixin flex($direction: row) {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: $direction;
	}
	.indicator {
		@include flex(row);
		justify-content: center;
		&__dot {
			height: 6px;
			width: 6px;
			border-radius: 100px;
			background-color: rgba(255, 255, 255, 0.35);
			margin: 0 5px;
			transition: background-color 0.3s;
			&--active {
				background-color: #ffffff;
			}
		}
	}
	.indicator-num {
		padding: 10rpx 0;
		background-color: rgba(0, 0, 0, 0.35);
		border-top-left-radius: 100rpx;
    border-bottom-left-radius: 100rpx;
		width: 115rpx;
		@include flex;
		justify-content: center;
		&__text {
			color: #FFFFFF;
			font-size: 24rpx;
		}
	}
</style>